import request from '@/utils/request'

const baseUrl = '/prot/region'

export function getRegionPage(params) {
  return request({
    url: `${baseUrl}`,
    method: 'get',
    params: params
  })
}

export function listByPid(pid) {
  return request({
    url: `${baseUrl}/listByPid/${pid}`,
    method: 'get'
  })
}

export function getRegionById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function saveRegion(region) {
  return request({
    url: `${baseUrl}`,
    method: 'post',
    data: region
  })
}

export function updateRegion(region) {
  return request({
    url: `${baseUrl}`,
    method: 'put',
    data: region
  })
}
export function deleteRegionById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function deleteRegionBatch(ids) {
  return request({
    url: `${baseUrl}/batch`,
    method: 'delete',
    params: { ids: ids }
  })
}

